package com.mys.dxc;
public class CountDuoXiancheng implements Runnable {

	
	private int count = 20;

	public static void main(String[] args) {
		
		CountDuoXiancheng cdx1 = new CountDuoXiancheng();
		
		Thread t1 = new Thread(cdx1,"线程1");
		Thread t2 = new Thread(cdx1,"线程2");
		Thread t3 = new Thread(cdx1,"线程3");
		//t3.setPriority(10);
		t2.start();
		t1.start();
		t3.start();
	
		
	}

	@Override
	public  void run() {
		
			synchronized (this) {
				for(int i=0;i<10;i++){
					if(count>0){
						
						System.out.println(Thread.currentThread().getName()+":"+count--);
						
					}
				}
				
			}
			
		
	}

}
